Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More updates for recent compiler changes for ref fields #73883

Merged
merged 2 commits into from
Aug 13, 2022

Conversation

cston
Copy link
Member

@cston cston commented Aug 13, 2022

Updates to compile with the latest C# compiler.

Compiles cleanly from the root with build -rc Release - with the exception of tools/dotnet-pgo which fails to compile since it still references .NET preview 5 SDK.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@cston
Copy link
Member Author

cston commented Aug 13, 2022

cc @AaronRobinsonMSFT, @jaredpar

@hoyosjs
Copy link
Member

hoyosjs commented Aug 13, 2022

Failure is #69125/#73621

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit f6d2d09 into dotnet:main Aug 13, 2022
@cston cston deleted the more-scoped branch August 13, 2022 14:40
@MichalStrehovsky
Copy link
Member

Just to double-check: is scoped a known breaking change to the language? Looking at the history, we haven't made meaningful changes to DispatchEx that is being modified here for years.

@cston
Copy link
Member Author

cston commented Aug 15, 2022

The breaking change with the C#11 compiler is: when compiling with .NET 7.0 or -langversion:11, a ref struct instance or ref or out parameter is assumed to capture unscoped references (either unscoped parameters passed by reference or ref fields from ref struct parameters).

To work around the breaking change, the frameIter parameter in DispatchEx() was marked as scoped to indicate that it is not captured.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants